package ai.zixing.example02;

public class Client {
    public static void main(String[] args) {

        GobangFactory factory = GobangFactory.getInstance();
        GobangFlyweight b1 = factory.getGoBang("b");
        GobangFlyweight b2 = factory.getGoBang("b");
        GobangFlyweight b3 = factory.getGoBang("b");
        System.out.println(b1 == b2);
        System.out.println(b3 == b2);

        GobangFlyweight w1 = factory.getGoBang("w");
        GobangFlyweight w2 = factory.getGoBang("w");
        System.out.println(w1 == w2);

        b1.display();
        b2.display();
        b3.display();
        w1.display();
        w2.display();
    }
}
